Skip to content

Avoid creating Strings during distribution gen (WIP)#57

Closed
alamb wants to merge 1 commit intoclflushopt:mainfrom
alamb:alamb/faster_table_gen
Closed

Avoid creating Strings during distribution gen (WIP)#57
alamb wants to merge 1 commit intoclflushopt:mainfrom
alamb:alamb/faster_table_gen

Conversation

@alamb
Copy link
Copy Markdown
Collaborator

@alamb alamb commented Mar 21, 2025

I was trying to make the startup time faster and one thing I figured I could do is stop copying strings during text pool generation.

However I made the change to avoid copying and it doesn't really seem to have helped, but I figured I would put up the PR in case someone else was interested

Main

(venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/tpchgen-rs$ time target/release/tpchgen-cli -s 1 --tables=nation --output-dir=/tmp/tpchdbgen-rs
Generation complete!

real	0m1.955s
user	0m1.901s
sys	0m0.051s

This branch:

branch 'alamb/faster_table_gen' set up to track 'alamb/alamb/faster_table_gen'.
(venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/tpchgen-rs$ time target/release/tpchgen-cli -s 1 --tables=nation --output-dir=/tmp/tpchdbgen-rs
Generation complete!

real	0m1.953s
user	0m1.910s
sys	0m0.039s

pub struct Distribution {
name: String,
values: Vec<String>,
values: Vec<&'static str>,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was to not allocate strings

@alamb
Copy link
Copy Markdown
Collaborator Author

alamb commented Mar 25, 2025

This was done for real in #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant